<style type="text/css" media="screen">
.n-bottom span.n-error{
    margin-top: -10px !important;
}
hr {
    margin-top: 0px;
    margin-bottom: 15px;
    border: 0;
    border-top: 1px solid #ccc;
}

</style>
<form id="add-form" class="form-horizontal " role="form" data-toggle="validator" method="POST" action="">
    <div class="row">
        <div class="form-group col-sm-6">
            <label class="control-label col-xs-12 col-sm-3"><span style="color: red;">*</span>项目名称:</label>
            <div class="col-xs-12 col-sm-9">
                <input class="form-control" id="name" name="row[{$pre}name]" type="text"  placeholder="请填写项目名称" value="{$row['name']}" data-rule="required">
                <span class="msg-box n-bottom"></span>
            </div>
        </div>

        {volist name="list" id="vo" key="k"}

            <div class="form-group  col-sm-6 {$vo.div_class}" style="height: {if $vo.item_type != 'text'}50{else}100{/if}px;" >
                <label class="control-label col-xs-12 col-sm-3">{if $vo.item_required == 1 or $vo.item_class =='land_time'}<span style="color: red;">*</span>{/if}{$vo.item_label}:<br>{$vo.item_label_extra}</label>
                <div class="col-xs-12 col-sm-9">
                    {switch name="vo.item_type" }
                        {case value="string"}
                            {if $vo.item_pending == 1}
                            <div class="input-group">

                              <input class="form-control {$vo.item_class}" id="{$vo.item_id}" name="row[{$vo.item_id}]" type="text"  placeholder="请填写{$vo.item_label}" value="$row[$vo.original_item_id]}" {$vo.item_data_rule}>
                               <span class="input-group-addon">
                              <input type="checkbox" class="pending" data-id="{$vo.item_id}" >待定
                                </span>

                            </div>
                            {else/}
                                <input class="form-control {$vo.item_class}" id="{$vo.item_id}" name="row[{$vo.item_id}]" type="text"  placeholder="请填写{$vo.item_label}" value="{$row[$vo.original_item_id]}"  {$vo.item_data_rule}>
                                <!-- <span class="msg-box n-bottom"></span> -->
                            {/if}
                        {/case}
                        {case value="price"}
                                {if $vo.item_pending == 1}
                                <div class="input-group">
                                  <input class="form-control {$vo.item_class}" id="{$vo.item_id}" name="row[{$vo.item_id}]" type="text"  placeholder="请填写{$vo.item_label}" {:$row[$vo.original_item_id]== '-100'?"readonly":""} {$vo.item_data_rule} {$vo.item_data_msg} onkeyup="clearNoNum(this)" value="{:$row[$vo.original_item_id]?($row[$vo.original_item_id]==-100?'待定':$row[$vo.original_item_id]):''}">
                                   <span class="input-group-addon">
                                  <input type="checkbox" class="pending" data-id="{$vo.item_id}"  {:$row[$vo.original_item_id]==-100?'checked':''}>待定
                                    </span>

                                </div>
                                {else/}
                                    <input class="form-control {$vo.item_class}" id="{$vo.item_id}" name="row[{$vo.item_id}]" type="text"  placeholder="请填写{$vo.item_label}"  value="{:$row[$vo.original_item_id]?($row[$vo.original_item_id]==-100?'待定':$row[$vo.original_item_id]):''}" {$vo.item_data_rule} {$vo.item_data_msg} onkeyup="clearNoNum(this)">

                                {/if}

                        {/case}
                        {case value="datetime|date"}
                            {if $vo.item_pending == 1}
                            <div class="input-group">
                              <input class="form-control {:$row[$vo.original_item_id]==-100?'':'datetimepicker'}  {$vo.item_class}"  type="text" id="{$vo.item_id}" name="row[{$vo.item_id}]"  data-date-format="YYYY-MM-DD" data-use-current="true" placeholder="请填写{$vo.item_label}" value="{:$row[$vo.original_item_id]==-100?'待定':$row[$vo.original_item_id.'_desc']}" {$vo.item_data_rule} {$vo.item_data_msg} >
                               <span class="input-group-addon">
                                <input type="checkbox" class="pending" data-id="{$vo.item_id}"  {:$row[$vo.original_item_id]==-100?'checked':''}>待定
                                </span>
                            </div>

                            {else/}
                                <input class="form-control datetimepicker {$vo.item_class}"  type="text" id="{$vo.item_id}" name="row[{$vo.item_id}]"  data-date-format="YYYY-MM-DD" data-use-current="true" placeholder="请填写{$vo.item_label}" value="{:$row[$vo.original_item_id]==-100?'待定':$row[$vo.original_item_id.'_desc']}" {$vo.item_data_rule} {$vo.item_data_msg}>

                            {/if}
                        {/case}
                        {case  value="selects"}
                            <select
                                class="form-control selectpicker"
                                id="{$vo.item_id}"
                                name="row[{$vo.item_id}][]"
                                multiple
                                {if $vo.item_required==1}data-rule="required;"{/if}
                                title="请选择"
                                >
                                {volist name="vo.item_rule.datasource" id="vv"}
                                    <option value="{$key}" {in name="key" value="$row[$vo.original_item_id]" }selected{/in}>{$vv}</option>
                                {/volist}
                            </select>
                        {/case}
                        {case value="select"}
                            {if isset($vo['item_rule']['is_relation']) && $vo['item_rule']['is_relation'] == "1" /}
                            <div class="row">
                                <div class="col-sm-5" style="padding-right: 0px">
                                    <select class="form-control relation "  name="row[{$vo.item_id}]" id="{$vo.item_id}" {if $vo.item_required==1}data-rule="required;"{/if}>
                                        <option value="">请选择</option>
                                        {volist name="vo.item_rule.datasource" id="vv" }
                                            <option value="{$key}" {eq name="key" value="$row[$vo.original_item_id]"}selected{/eq}>{$vv}</option>
                                        {/volist}
                                    </select>
                                </div>
                                <div class="col-sm-5" style="padding-left:0px;padding-right: 0px;">
                                    <div class="input-group">
                                        <input class="form-control " id="{$vo.item_id}_relation" name="row[{$vo.item_id}_relation]" value="{$row[$vo.original_item_id.'_relation']}">
                                        <span class="input-group-addon">
                                        <input type="checkbox" class="pending pending-date"
                                            {:$row[$vo.original_item_id.'_relation']=='待定'?'checked':''}
                                            data-id="{$vo.item_id}_relation"
                                            aria-label="...">待定
                                        </span>
                                    </div>
                                </div>
                                <div class="col-sm-2" style="padding-left:2px;padding-right: 0px;line-height: 31px;"><span id="{$vo.item_id}_addon">{$row[$vo.original_item_id.'_relation_unit']}</span></div>
                            </div>
                            {else/}
                                <select class="form-control {$vo.item_class}" name="row[{$vo.item_id}]" id="{$vo.item_id}" {if $vo.item_required==1}data-rule="required;"{/if}>

                                    <option value="">请选择</option>
                                    {volist name="vo.item_rule.datasource" id="vv" }
                                        <option  value="{$key}" {eq name="key" value="$row[$vo.original_item_id]"}selected{/eq}>{$vv}</option>
                                    {/volist}
                                </select>
                            {/if}

                        {/case}
                        {case value="radio"}
                            <select class="form-control {$vo.item_class}" id="{$vo.item_id}"  name="row[{$vo.item_id}]" >
                                <option value="">请选择</option>
                                {if $vo.item_class=='command_type'}
                                    <option value="省、市重点推进“双招双引”项目" {:$row[$vo.item_id]=="省、市重点推进“双招双引”项目"?"selected":""}>省、市重点推进“双招双引”项目</option>

                                    <option value="市指挥部50个招商引资重点推进项目" {:$row[$vo.item_id]=="市指挥部50个招商引资重点推进项目"?"selected":""}>市指挥部50个招商引资重点推进项目</option>

                                    <option value="区主要领导同志接洽重点在谈项目" {:$row[$vo.item_id]=="区主要领导同志接洽重点在谈项目"?"selected":""}>区主要领导同志接洽重点在谈项目</option>
                                {else}
                                    <option value="是" {:$row[$vo.item_id]=="是"?"selected":""}>是</option>
                                    <option value="否" {:$row[$vo.item_id]=="否"?"selected":""}>否</option>
                                    {if $vo.item_class=='access'}
                                    <option value="无" {:$row[$vo.item_id]=="无"?"selected":""}>无须上准入例会项目</option>
                                    {/if}
                                {/if}
                            </select>
                        {/case}

                        {case value="text"}
                            <textarea  class="form-control {$vo.item_class}"  id="{$vo.item_id}" name="row[{$vo.item_id}]" rows="{$vo.item_rule.row}" cols="50" placeholder="请填写{$vo.item_label}" {$vo.item_data_rule}>{$row[$vo.original_item_id]|htmlentities}</textarea>
                        {/case}
                    {/switch}

                    <span class="msg-box n-bottom"></span>
                </div>
            </div>
        {/volist}
    </div>
    <hr>
    <div class="row">
        <div class="form-group col-sm-6" style="height: 50px;">
            <label class="control-label col-xs-12 col-sm-3">社会化招商:</label>
            <div class="col-xs-12 col-sm-9">
                <select class="form-control" id="{$pre}project_socialized" name="row[{$pre}project_socialized]" >
                    <option value="">请选择</option>
                    <option value="是">是</option>
                    <option value="否">否</option>
                </select>

            </div>
        </div>
       <!--  <div class=" socialized " style="display: none">
            <div class="form-group col-sm-6" style="height: 50px;">
                <label class="control-label col-xs-12 col-sm-3"><span style="color: red;">*</span>引荐人:</label>
                <div class="col-xs-12 col-sm-9">
                    <input class="form-control" id="{$pre}referrer" name="row[{$pre}referrer]" type="text"  placeholder="请填写引荐人" value="" >
                    <span class="msg-box n-bottom"></span>
                </div>
            </div>
            <div class="form-group  col-sm-6" style="height: 50px;">
                <label for="c-flag" class="control-label col-xs-12 col-sm-3">{:__('初次备案')}:</label>
                <div class="col-xs-12 col-sm-9">
                    <input id="{$pre}first_registration_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[{$pre}first_registration_time]" type="text">
                    <span class="msg-box n-bottom"></span>
                </div>
            </div>
            <div class="form-group col-sm-6" style="height: 160px;">
                <label for="{$pre}first_registration_images" class="control-label col-xs-12 col-sm-3">{:__('初次备案附件')}:</label>
                <div class="col-xs-12 col-sm-9">
                    <div class="input-group">
                        <input id="{$pre}first_registration_images" class="form-control" size="35" name="row[{$pre}first_registration_images]" type="text" readonly>
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="plupload-{$pre}first_registration_images" class="btn btn-danger plupload" data-input-id="{$pre}first_registration_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-{$pre}first_registration_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        </div>

                    </div>
                    <span class="msg-box n-bottom"></span>
                    <ul class="row list-inline plupload-preview" id="p-{$pre}first_registration_images"></ul>

                </div>
            </div>
            <div class="form-group  col-sm-6" style="height: 50px;">
                <label for="c-flag" class="control-label col-xs-12 col-sm-3">{:__('二次备案')}:</label>
                <div class="col-xs-12 col-sm-9">
                    <input id="{$pre}second_registration_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[{$pre}second_registration_time]" type="text">
                    <span class="msg-box n-bottom"></span>
                </div>
            </div>
            <div class="form-group col-sm-6" style="height: 160px;">
                <label for="{$pre}second_registration_images" class="control-label col-xs-12 col-sm-3">{:__('二次备案附件')}:</label>
                <div class="col-xs-12 col-sm-9">
                    <div class="input-group">
                        <input id="{$pre}second_registration_images" class="form-control" size="35" name="row[{$pre}second_registration_images]" type="text" readonly>
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="plupload-{$pre}second_registration_images" class="btn btn-danger plupload" data-input-id="{$pre}second_registration_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-{$pre}second_registration_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        </div>
                    </div>
                    <span class="msg-box n-bottom"></span>
                    <ul class="row list-inline plupload-preview" id="p-{$pre}second_registration_images"></ul>

                </div>
            </div>
             <div class="form-group  col-sm-6" style="height: 50px;">
                <label for="c-flag" class="control-label col-xs-12 col-sm-3">{:__('最终确认')}:</label>
                <div class="col-xs-12 col-sm-9">
                    <input id="{$pre}final_confirm_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[{$pre}final_confirm_time]" type="text" >
                    <span class="msg-box n-bottom"></span>
                </div>
            </div>
            <div class="form-group col-sm-6" style="height: 160px;">
                <label for="{$pre}final_confirm_images" class="control-label col-xs-12 col-sm-3">{:__('最终确认附件')}:</label>
                <div class="col-xs-12 col-sm-9">
                    <div class="input-group">
                        <input id="{$pre}final_confirm_images" class="form-control" size="35" name="row[{$pre}final_confirm_images]" type="text"  readonly>
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="plupload-{$pre}final_confirm_images" class="btn btn-danger plupload" data-input-id="{$pre}final_confirm_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-{$pre}final_confirm_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        </div>
                    </div>
                    <span class="msg-box n-bottom"></span>
                    <ul class="row list-inline plupload-preview" id="p-{$pre}final_confirm_images"></ul>

                </div>
            </div>
            <div class="form-group col-sm-6" style="height: 50px;">
                <label for="c-flag" class="control-label col-xs-12 col-sm-3">{:__('奖励申请')}:</label>
                <div class="col-xs-12 col-sm-9">
                    <input id="{$pre}reward_application_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[{$pre}reward_application_time]" type="text" >
                    <span class="msg-box n-bottom"></span>
                </div>
            </div>
            <div class="form-group col-sm-6" style="height: 160px;">
                <label for="{$pre}reward_application_images" class="control-label col-xs-12 col-sm-3">{:__('奖励申请附件')}:</label>
                <div class="col-xs-12 col-sm-9">

                <div class="input-group">
                    <input id="{$pre}reward_application_images" class="form-control" size="35" name="row[{$pre}reward_application_images]" type="text" readonly>
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="plupload-{$pre}reward_application_images" class="btn btn-danger plupload" data-input-id="{$pre}reward_application_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-{$pre}reward_application_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    </div>
                </div>
                <span class="msg-box n-bottom"></span>
                <ul class="row list-inline plupload-preview" id="p-{$pre}reward_application_images"></ul>

                </div>
            </div>
        </div> -->
    </div>




    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script type="text/javascript">
    function clearNoNum(obj){
        obj.value = obj.value.replace(/[^\d.]/g,"");//清除"数字"和"."以外的字符
        obj.value = obj.value.replace(/^\./g,"");//验证第一个字符是数字而不是字符
        obj.value = obj.value.replace(/\.{2,}/g,".");//只保留第一个.清除多余的
        obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3');//只能输入两个小数
    }
</script>
